// FilterSet.java
//
// Informatics 102 Spring 2012
// Assignment #2: Metadata and Reflection
//
// This class represents a set of filters available to the application.
// You should not modify this class; instead, modify the FilterPlugInLoader
// class in the inf102.assignment2.plugins package.

package inf102.assignment2.filters;

import inf102.assignment2.plugins.FilterPlugInLoader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;


public class FilterSet
{
	private List<Filter> filters;
	

	// load() loads a FilterSet, given the path to a configuration file.
	public static FilterSet load(String configurationFile)
	{
		return new FilterSet(configurationFile);
	}
	
	
	private FilterSet(String configurationFile)
	{
		filters = new ArrayList<Filter>();

		filters.add(new HorizontalMirroringFilter());

		filters.addAll(
			new FilterPlugInLoader().loadFilters(configurationFile));
	}
	

	// getFilters() returns an unmodifiable list of filters in this set.
	public List<Filter> getFilters()
	{
		return Collections.unmodifiableList(filters);
	}
}
